﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ImageListItem : System.Web.UI.UserControl, IPostBackEventHandler
    {
        public string DisplayText
        {
            get { return displayText.Text; }
            set { displayText.Text = value; }
        }
        public string Values
        {
            get { return myvalue.Value; }
            set { myvalue.Value = value; }
        }
        public string Data
        {
            get { return mydata.Value; }
            set { mydata.Value = value; }
        }
       
        public event EventHandler DivClick;
        protected void Page_Load(object sender, EventArgs e)
        {
            string script = Page.ClientScript.GetPostBackEventReference(this, this.MainDiv.ID);
            this.MainDiv.Attributes.Add("onclick", script);
        }

        public void RaisePostBackEvent(string eventArgument)   //implement the IPostBackEventHandler interface
        {
            if (DivClick != null && eventArgument == this.MainDiv.ID)
            {
                DivClick(this.MainDiv, new EventArgs());
            }
        }
    }

